﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using UniMana.Utils.Controls;
using UniMana.Data;

namespace UniMana.Win.Training
{
    public partial class Report_Student_Certificate : DevExpress.XtraReports.UI.XtraReport
    {
        public Report_Student_Certificate(bds _bdsSource)
        {
            InitializeComponent();
            DBMain data = new DBMain();
            DateTime d = data.m_DCReadOnly.GetSystemDate();
            this.DataSource = _bdsSource;
            //xrtIndex.DataBindings.Add("Text", this.DataSource, "GhiChu");
            xrtKhoa.DataBindings.Add("Text", this.DataSource, "DepartmentName");
            xrtLop.DataBindings.Add("Text", this.DataSource, "ClassName");
            xrtID.DataBindings.Add("Text", this.DataSource, "ID");
            xrtLastName.DataBindings.Add("Text", this.DataSource, "LastName");
            xrtSureName.DataBindings.Add("Text", this.DataSource, "SureName");
            xrtBirthday.DataBindings.Add("Text", this.DataSource, "Birthday", "{0:dd/MM/yyyy}");
            xrtGender.DataBindings.Add("Text", this.DataSource, "Gender");

            xrtPlaceOfBirth.DataBindings.Add("Text", this.DataSource, "PlaceOfBirth");
            xrtAddress.DataBindings.Add("Text", this.DataSource, "Address");
            xrtNameSV.Text =xrtLastName.DataBindings.Add("Text", this.DataSource, "LastName") + " " + xrtSureName.DataBindings.Add("Text", this.DataSource, "SureName");

            xrLabel30.Text = "Tân An, ngày " + d.Day + " ,tháng " + d.Month + " ,năm " + d.Year;
        }

        private void Report_Student_Certificate_ParametersRequestSubmit(object sender, DevExpress.XtraReports.Parameters.ParametersRequestEventArgs e)
        {
            xrlHocKy.Text = this.HocKy.Value.ToString();
            xrlSVNamThu.Text = this.SVNam.Value.ToString();
            xrlNamHoc.Text = this.NamHoc.Value.ToString();
            xrlMucDichSD.Text = this.MucDich.Value.ToString();
        }

    }
}
